package cn.lili.modules.member.client;

import cn.lili.modules.constant.ServiceConstant;
import cn.lili.modules.member.fallback.ArticleFallback;
import cn.lili.modules.page.entity.dos.Article;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

import javax.validation.constraints.NotNull;
import java.util.List;

@FeignClient(path = "${server.servlet.context-path}", name = ServiceConstant.SYSTEM_SERVICE, contextId = "short-article", fallback = ArticleFallback.class)
public interface ArticleClient {

    @GetMapping(value = "/type/all/{type}")
    List<Article> getAllByType(@NotNull(message = "文章类型") @PathVariable("type") String type);
}
